---
title: ChatBaiduQianfan
---

## Setup

You'll first need to install the [`@langchain/baidu-qianfan`](https://www.npmjs.com/package/@langchain/baidu-qianfan) package:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/baidu-qianfan @langchain/core
```

Available models: `ERNIE-Bot`,`ERNIE-Lite-8K`,`ERNIE-Bot-4`,`ERNIE-Speed-8K`,`ERNIE-Speed-128K`,`ERNIE-4.0-8K`,
`ERNIE-4.0-8K-Preview`,`ERNIE-3.5-8K`,`ERNIE-3.5-8K-Preview`,`ERNIE-Lite-8K`,`ERNIE-Tiny-8K`,`ERNIE-Character-8K`,
`ERNIE Speed-AppBuilder`

Abandoned models: `ERNIE-Bot-turbo`

## Usage

import ChatBaiduQianfan from "/snippets/javascript-integrations/examples/models/chat/chat_baidu_qianfan.mdx";

<ChatBaiduQianfan />

## Streaming

Qianfan's API also supports streaming token responses. The example below demonstrates how to use this feature.

import ChatStreamBaiduQianfan from "/snippets/javascript-integrations/examples/models/chat/chat_stream_baidu_qianfan.mdx";

<ChatStreamBaiduQianfan />

## Related

- Chat model [conceptual guide](/oss/langchain/models)
- Chat model [how-to guides](/oss/langchain/models)
